home *** CD-ROM | disk | FTP | other *** search
- Path: news.uminho.pt!newsadm
- From: Rui Bastos <rui@jupiter.di.uminho.pt>
- Newsgroups: comp.lang.c
- Subject: realloc(NULL,100)
- Date: Wed, 28 Feb 1996 14:54:40 +0000
- Organization: Universidade do Minho
- Message-ID: <31346CB0.41C67EA6@jupiter.di.uminho.pt>
- NNTP-Posting-Host: jupiter.di.uminho.pt
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3 sun4c)
-
- Hi,
-
- Does anybody knows what's the expected behaviour of this program?
-
- #include <stdio.h>
- #include <malloc.h>
-
- main()
- {
- void *x=NULL;
- x=realloc(NULL,100);
- printf("%p\n",x);
- }
-
- I tested it under diferent compilers/operating systems
- and it returns null, others returns a valid address and other
- crashes.
-
- Regars,
-
- PS please and send me an email if you reply to this post.
- --
- Rui Duarte Tavares Bastos rui@jupiter.di.uminho.pt
- Home page : http://jupiter.di.uminho.pt/~rui
- Sporting Home page : http://jupiter.di.uminho.pt/~rui/futebol/sporting
-